var app = sm("do_App");
var page = sm("do_Page");
var hashdata = mm("do_HashData");
var nf = sm("do_Notification");
var allpage = require("helper/allpage");
var openHelper = require("helper/open");
var userUtil = require("helper/user");

var rootview = ui("$");

page.on("cartNumRefresh",function(data){
	if(data > 0){
		ui("cartNumLayout").visible = true;
		ui("cartNum").text = data;
	}else{
		ui("cartNumLayout").visible = false;
	}
});

/*
 * 购物车 
 */
ui("headRight").on("touch",function(){
	if(!userUtil.loginToken()){
		openHelper.openLogin();	
	}else{
		openHelper.open("source://view/mall/cart/main.ui",{},"","pay_product_back");
	}
});

var searchAout=ui("searchAout");
searchAout.on("touch",'',300,function(){
	openHelper.open("source://view/mall/search/main.ui");
});
